<%--
  Created by IntelliJ IDEA.
  User: melt
  Date: 2021/10/29
  Time: 21:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>查看商家</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
    <style>
        img {
            width: 40px;
            height: 30px;
        }
        .msg {
            width: 600px;
            text-align: center;
            color: red;
            font-size: 14px;
            margin: 0 auto;
        }

        .pageIndex {
            width: 600px;
            text-align: center;
            margin: 30px auto;
        }

        .pageIndex a {
            width: 30px;
            height: 30px;
            display: inline-block;
            text-align: center;
            line-height: 30px;
            background-color: #009688;
            color: white;
            text-decoration: none;
        }

        .active {
            background-color: #FF5722 !important;
        }
        .list{
            width: 96%;
            margin: 30px auto;
        }
    </style>

</head>
<body>
<div class="list">
    <table class="table table-bordered">
        <tr align="center">
            <td>商家编号</td>
            <td>商品Id</td>
            <td>商家名字</td>
            <td>商家详细信息</td>
        </tr>
        <c:forEach items="${page.list}" var="merchant" varStatus="status">
            <tr>
                <td align="center">${(page.pageSize*(page.currentIndex-1))+status.index+1}</td>
                <td align="center">${merchant.merchantId}</td>
                <td align="center">${merchant.merchantName}</td>
                <td align="center">${merchant.merchantParticulars}</td>
            </tr>
        </c:forEach>
    </table>
</div>>
<div class="pageIndex">
    <c:forEach items="${page.pageIndex}" var="item">
        <c:if test="${item ne '...'}">
            <c:if test="${(page.currentIndex eq item) && !(empty item) }">
                <a class="active" href="${pageContext.request.contextPath}/super/merchantList?index=${item}">${item}</a>
            </c:if>
            <c:if test="${page.currentIndex ne item && !(empty item)}">
                <a href="${pageContext.request.contextPath}/super/merchantList?index=${item}">${item}</a>
            </c:if>
        </c:if>
        <c:if test="${item eq '...'}">
            <a href="">${item}</a>
        </c:if>
    </c:forEach>
</div>
<div style="width: 600px;text-align: center;margin: 0 auto">当前第${page.currentIndex}页，共${page.totalPage}页</div>
</body>
</html>
